<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@include file="header.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DtdHTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
-->
</style>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Add Gift</title>
<script>
	$(document).ready(function(){
	    $("table tbody tr:even").addClass("tdbgcolor1"); 
	    $("table tbody tr:odd").addClass("tdbgcolor2"); 
	});
	function checkAndSubmit(){
		var form = document.getElementById("updateGiftForm");
		form.submit();
	}
	function showUploadWindow(id,suffer){
		var InfoW=620;
		var InfoH=400;
		var InfoUrl="edit/insert_images.action?uploadFolder=<%=com.windfone.common.Constant.UPLOAD_GIFT %>";
		var str=window.showModalDialog(InfoUrl,"","dialogWidth="+InfoW+"px;dialogHeight="+InfoH+"px;center=yes;help=no;resizable=no;status=no;scroll=no");
		if ( str != undefined){
			$("#"+id).val(str);
			$("#"+id+ suffer).attr("src","<%=contextPath%>/"+str);
		}		
	}	
</script>
</head>
<body>
<div align="center">新增礼品</div>
<form method="post" action="updateGift.action" id="updateGiftForm">
<table width="80%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF" align="center">
	<tr>
		<td width="18%">礼品名称:</td>
		<td width="82%"><input name="name" type="text" id="name" size="50" value="${bean.name }" maxlength="25"/>
	  </td>
	</tr>
	 
	<tr>
		<td>所需积分:</td>
		<td><input name="jifen" type="text" id="jifen" size="50" maxlength="25" value="${bean.jifen }" /></td>
	</tr>
	<tr>
		<td>出库数量:</td>
		<td><input name="account" type="text" id="account" size="50" maxlength="25"  value="${bean.account }"/></td>
	</tr>
	<tr>
		<td>图片1:</td>
	  	<td>
			<img name="imagepath10" id="imagepath10" src="<%=contextPath%>/<s:property value='bean.imagepath'/>" /><input type="button" value="照片"  onClick="showUploadWindow('imagepath','10')"/>(70*90)
		</td>
	</tr>	
	<tr>
		<td>图片2:</td>
	  	<td>
			<img name="imagepath20" id="imagepath20" src="<%=contextPath%>/<s:property value='bean.imagepath'/>" /><input type="button" value="照片"  onClick="showUploadWindow('imagepath2','20')"/>(70*90)
		</td>
	</tr>	
	<tr>
		<td>图片3:</td>
	  	<td>
			<img name="imagepath30" id="imagepath30" src="<%=contextPath%>/<s:property value='bean.imagepath'/>" /><input type="button" value="照片"  onClick="showUploadWindow('imagepath3','30')"/>(70*90)
		</td>
	</tr>	
	<tr>
		<td>图片4:</td>
	  	<td>
			<img name="imagepath40" id="imagepath40" src="<%=contextPath%>/<s:property value='bean.imagepath'/>" /><input type="button" value="照片"  onClick="showUploadWindow('imagepath4','40')"/>(70*90)
		</td>
	</tr>	
	<tr>

		<td colspan="2" >
			<input type="hidden" name="imagepath" id="imagepath" value="<s:property value='bean.imagepath'/>"/>
			<input type="hidden" name="imagepath2" id="imagepath2" value="<s:property value='bean.imagepath2'/>"/>
			<input type="hidden" name="imagepath3" id="imagepath3" value="<s:property value='bean.imagepath3'/>"/>
			<input type="hidden" name="imagepath4" id="imagepath4" value="<s:property value='bean.imagepath4'/>"/>
			<input type="button" value="Save"  onclick="checkAndSubmit()"/>&nbsp;
			<input	type="button" value="reset" />&nbsp;
			<input	type="button" value="返回"  onclick="javascript:window.history.back();" />
		</td>
</table>
</form>
</body>
</html>
